package com.cvai.handler;

import com.cvai.R.Result;
import com.cvai.exception.CvAiException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(CvAiException.class)
    public Result handleException(Exception e) {
        e.printStackTrace();
        // 处理异常
        return Result.error("服务器异常: "+e.getMessage());
    }
}
